import { h } from '@logicflow/core';
import { BaseInModel, BaseInView } from '../base/BaseInNode';

class EntryModel extends BaseInModel {
  initNodeData(data: any): void {
    super.initNodeData(data);
    this.text.value = 'Entry';
  }
}

class EntryView extends BaseInView {
  getIcon() {
    const { x, y } = this.props.model;
    const width = 30;
    const height = 40;
    return h('image', {
      width,
      height,
      x: x - width / 2,
      y: y - height / 2 - 13,
      href: '',
    });
  }
}

export default {
  type: 'Entry',
  view: EntryView,
  model: EntryModel,
};
